<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt"%>
<%
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ request.getContextPath();
%>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
 		<link rel="stylesheet" type="text/css" href="<%=basePath %>/css/updateVideo.css" />
        <link rel="stylesheet" href="<%=basePath %>/css/list.css">
		<link href="<%=basePath %>/css/H-ui.min.css" rel="stylesheet" type="text/css" />
		<link href="<%=basePath %>/css/formsCSS.css" rel="stylesheet" type="text/css" />
		<script src="<%=basePath%>/lib/My97DatePicker/WdatePicker.js"></script>
		<script src="<%=basePath %>/js/jquery.min.js"></script>
		<script src="<%=basePath %>/js/formsJS.js"></script>

<script type="text/javascript">

function checkForm(f){

	if(f.name.value.replace(/\s/g,'') == ''){
		alert("分类名称不能为空");
		return false;
	}
	if(f.sort.value.replace(/\s/g,'')==''){
		alert("排序不能为空");
		return false;
	}
	return true;
}

</script>
</head>
<body>
		<div class="connect_wrap">
    		<h3 style= "text-align: center;">分类管理维护</h3>
			<div class="row cl" style="max-width:88%;margin-left:8%;">
			<div class="labelText"></div>
				<form action="<%=basePath%>/CourseCategory/CourseCategoryEdit" method="post" onsubmit="return checkForm(this)"
					enctype="multipart/form-data">
					<div class="col-sm-4"></div>
	    					<div class="col-sm-4">
	    							<div class="boxs">
										<input type="hidden" name="id" value="${courseCategory.id}">
										<input type="text" class="inputBox" placeholder="分类名称" name="name" value="${courseCategory.name}" >
										<select class="selectBox" id="parentId" name="parentId">
											<option value="">----请选择上级分类----</option>
											<c:forEach items="${ddl}" var="p">
							    				<option value="${p.id}" ${p.id == courseCategory.parentId ? 'selected="selected"' : ''}>${p.id}:${p.name}</option>
							    			</c:forEach>
										</select>
										<input type="number" class="inputBox" placeholder="排序" name="sort" value="${courseCategory.sort}" >
										 <input type="file" class="inputBox" name="imgFile"  value="${indexType.icon}" placeholder="分类图标"><br /><br />											 
									    <input type="text" placeholder="创建时间" class="name Wdate inputBox" name="create_Time" value="${courseCategory.create_time}" 
									    		onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"><br /><br />
				    						     
												
											<input type="submit" value="确定" class="true" />
											<input type="button"  class="false" value="取消" onclick="window.history.go(-1)">
										</div>
								</div>
					</form>
			</div>
	</div>
	
</body>
	 
</html>